home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / SETMODE.C < prev    next >
Encoding:
Text File  |  1991-08-05  |  407 b   |  17 lines

  1. /* setmode.c, from page 367 of Turbo C Bible */
  2. #include <stdio.h>
  3. #include <io.h>
  4. #include <fcntl.h>
  5. main ()
  6. {
  7.                /* Set mode of stdout to O_BINARY (binary mode) */
  8.    if (setmode (fileno (stdout), O_BINARY) == -1)
  9.    {
  10.         perror ("setmode failed");
  11.    }
  12.    else
  13.    {
  14.         printf ("stdout is in binary mode now.\n");
  15.         printf ("Notice how this output looks.\n");
  16.    }
  17. }